package com.project.seckill.util;

import com.project.seckill.bo.JsonEntity;
import com.project.seckill.constant.CodeMessage;

/**
 * Created by yachao on 2018/6/24.
 */
public class ResponseHelper {

    public static JsonEntity createInstance(Object data) {
        JsonEntity jsonEntity = new JsonEntity(data);
        return jsonEntity;
    }

    public static JsonEntity of(Object data) {
        return createInstance(data);
    }

    public static JsonEntity error(CodeMessage codeMessage) {
        JsonEntity jsonEntity = new JsonEntity(codeMessage);
        return jsonEntity;
    }

    public static JsonEntity ofNothing() {
        return createInstance(null);
    }
}
